(function () {
    var MapLayer = YYC.Class(Layer,{
        Init: function () {},
        Protected: {
            //实现父类的抽象保护方法
            P__createCanvas: function () {
                var canvas = $('<canvas/>', {
                    //id: id,
                    width: '600',
                    height: '600',
                    css: {
                        'position': 'absolute',
                        'top': '0px',
                        'left': '0px',
                        'border': '1px solid blue',
                        'z-index': 0
                    }
                })
                $('body').append(canvas)

                this.P__canvas = canvas[0]
            }
        },
        Public:{
            draw:function () {
                var imgs = this.getChilds()
                //this.P__context.drawImage(main.imgLoader.get('ground'), 0, 0)
                var img = imgs[0]
                for (var i = 0; i < img.length; i++) {
                    this.P__context.drawImage(img[i].img, img[i].x,img[i].y,img[i].width,img[i].height)
                }
            },
            render:function () {
                this.draw()
            }
        }
    })
    window.MapLayer = MapLayer
}())